package com.pdsu.graduation_design.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MyDBOpenHelper extends SQLiteOpenHelper {
    public MyDBOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    //第一次启动创建
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE user02(id INTEGER PRIMARY KEY AUTOINCREMENT,uid INTEGER(0) ,username VARCHAR(200),usertoken VARCHAR(200),phone VARCHAR(200))");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

        db.execSQL("drop table if exists user");
        onCreate(db);
    }
}
